<template>
	<view v-if="show">
		<view  class="mask" style="height: 100vh;background-color: rgba(0,0,0,.5);">
			<view class="text-orange bg-white px-6 py-2 flex flex-column justify-between" style="border-radius: 20rpx; height: 300rpx; border: 4rpx solid #fc7c08;position: fixed;top: 50%;right: 50%;transform: translate(50%,-50%);">
				<view class="flex align-center" style="height: 200rpx;">
					<text>检测到当前未登录或登陆过期,是否前往登陆?</text>
				</view>
				<view class="flex justify-between">
					<view @click="login()" class="bg-success p-2 px-4 text-white">
						登陆
					</view>
					<view @click="cancel()" class="bg-danger p-2 px-4 text-white">
						取消
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"NotLogin",
		data() {
			return {
				
			};
		},
		props:{
			show:{
				type:Boolean,
				default:false
			},
			loginbeforeurl:{
				type:String,
				default:'/pages/index/index'
			}
		},
		methods:{
			login(){
				uni.clearStorage()
				uni.navigateTo({
					url:`/pages/Login/Login?loginbeforeurl=${this.loginbeforeurl}`
				})
			},
			cancel(){
				uni.clearStorage()
				this.$emit('hide',false)
			}
		}
	}
</script>

<style>

</style>